from flask import Flask

from settings import dev
from apps.users.view import users_bp
from apps.admin.view import admin_bp
from exts import db


# 创建app
def create_app():
    app = Flask(__name__, template_folder='../templates', static_folder='../static')
    app.config.from_object(dev.DevConfig)
    app.register_blueprint(admin_bp)
    app.register_blueprint(users_bp)
    # 数据库初始化
    db.init_app(app=app)
    return app
